package com.xuxu.pojo;


import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

@Data   //相当于 get/set/toString/equals/hashCode等方法
@Document(indexName = "888",type = "stu")   //设置索引的名称、域的名称
public class Stu {

    @Id //表示主键
    @Field(index = true,type = FieldType.Long, fielddata = true, store = true)
    private Long id;

    //index表示是否索引，type表示当前域的类型，store表示是否存储
    @Field(index = true,type = FieldType.Text,fielddata = true,store = true,analyzer = "ik_max_word")
    private String name;

    @Field(index = true,type = FieldType.Text, fielddata = true, store = true,analyzer = "ik_max_word")
    private String address;
}
